var express = require("express");
var router = express.Router();
var db = require("../monmgoDB/db");
router.post("/upData", function (req, res, next) {
  var _id = req.body._id;
  db.updateOne({ _id }, req.body, function (err, data) {
    if (err) {
      res.send({
        code: 201,
        msg: "修改失败",
      });
    } else {
      res.send({
        code: 200,
        data,
        msg: "修改成功",
      });
    }
  });
});

module.exports = router;
